# encoding: utf-8
"""
@author: Dirac
@file: encrypt.py
@time: 2020/7/30 21:38
@desc: 加密
"""
import hashlib

from django.conf import settings


def md5(string):
    """md5加密"""
    hash_object = hashlib.md5(settings.SECRET_KEY.encode('utf-8'))
    hash_object.update(string.encode('utf-8'))
    return hash_object.hexdigest()